﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using FluentAssertions;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Support;
using OpenQA.Selenium.Support.PageObjects;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;
using System.Threading;

namespace DocProcessingWorkFlowScenarios
{
    [Binding]
    public class BBOSEnvDropdownSteps
    {
        BBOS_LoginPage loginPage = new BBOS_LoginPage();
        BBOS_WelcomePage welcomePage = new BBOS_WelcomePage();

        [Given]
        public void Given_I_am_logged_into_BBOS_system()
        {
            Thread.Sleep(4000);
            welcomePage.WelcomeMessage();            
            //BrowserUtility.Current.Url.Contains("http://dev.nexdox.com/DocProcessingWorkflow/");
        }

        [When]
        public void When_I_click_on_the_Env_Dropdown()
        {
            //Assert.IsTrue(BrowserUtility.Current.FindElement(By.Id("SelectedEnvironment")) != null);
            welcomePage.EnvirnomentDropDown();
    
        }

        [Then]
        public void Then_Three_Environments_are_displayed()
        {
            welcomePage.envOptions();

            //Assert.IsTrue(BrowserUtility.Current.PageSource.Contains("Production"), "Production envirnoment not displayed");
            //Assert.IsTrue(BrowserUtility.Current.PageSource.Contains("Test"), "Test envirnoment not displayed");
            //Assert.IsTrue(BrowserUtility.Current.PageSource.Contains("DryRun"), "DryRun envirnoment not displayed");

            //new SelectElement(BrowserUtility.Current.FindElement(By.Id("SelectedEnvironment"))).SelectByText("Production");
            //new SelectElement(BrowserUtility.Current.FindElement(By.Id("SelectedEnvironment"))).SelectByText("Test");
            //new SelectElement(BrowserUtility.Current.FindElement(By.Id("SelectedEnvironment"))).SelectByText("DryRun");


        }
    }
}
